#pragma once

#include "iostream"
#include "common.h"

namespace rex
{
	class Store
	{
	public:
		Store(const char* filename);
		~Store();

		//bool        is_changed;

		BaseHeader* get_header();
		size_t      update_file();

		bool        add_student(Student* stu);
		bool        delete_student(Node* stu);

		Node*       search_student(int student_number);
		Node*       search_student(const char* student_name);

	private:
		FILE*       fp;
		const char*       filename;
		BaseHeader  header;
		//Student*    students_table;
		Node*       list_header;

		int         read_header(void);
		size_t      read_record(size_t num);

		//size_t      write_header(BaseHeader* header);
		//size_t      write_records(void);
	};
	
}

